package cn.antho.superhelp.domain;

import com.baomidou.mybatisplus.enums.IdType;
import java.math.BigDecimal;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * <p>
 * 
 * </p>
 *
 * @author director
 * @since 2022-12-12
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("t_order")
public class Order extends Model<Order> {

    private static final long serialVersionUID = 1L;

    public static final Integer CHECKOUT_SUCCESS = 0;
    public static final Integer NO_APPOINTMENT_FOR_CONSTRUCTION = 1;
    public static final Integer RESERVED_FOR_CONSTRUCTION = 2;
    public static final Integer COMPLETION_OF_CONSTRUCTION = 3;
    public static final Integer FAILURE_OF_CONSTRUCTION = 4;
    public static final Integer CANCELLATION_OF_ORDER = -1;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 创建时间
     */
    @TableField("create_time")
    private Date createTime;
    /**
     * 最后支付更新时间
     */
    @TableField("update_time")
    private Date updateTime;
    /**
     * 订单编号
     */
    @TableField("order_no")
    private String orderNo;
    /**
     * 定金
     */
    private BigDecimal deposit;
    /**
     * 施工队id
     */
    @TableField("construction_team")
    private Long constructionTeam;
    /**
     * 支付总的价格
     */
    @TableField("total_amount")
    private BigDecimal totalAmount;
    /**
     * 预约单id
     */
    @TableField("reservation_no")
    private String reservationNo;
    /**
     *     // 订单状态 ：
    //0下单成功
    //1未预约待施工
    //2已预约待施工
    //3施工完成
    //4施工失败
    //-1取消订单
     */
    @TableField("status_order")
    private Integer statusOrder;
    /**
     * 支付方式:0余额直接，1支付宝，2微信,3银联
     */
    @TableField("pay_type")
    private Integer payType;
    /**
     * 预约时间
     */
    @TableField("appointment_time")
    private Date appointmentTime;
    /**
     * 实际时间
     */
    @TableField("real_appointment_time")
    private Date realAppointmentTime;
    /**
     * 照片
     */
    private String pics;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Order{" +
        ", id=" + id +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        ", orderNo=" + orderNo +
        ", deposit=" + deposit +
        ", totalAmount=" + totalAmount +
        ", reservationNo=" + reservationNo +
        ", statusOrder=" + statusOrder +
        ", payType=" + payType +
        "}";
    }
}
